package com.opencvtest;

import android.app.Activity;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

public class opencvtest extends Activity {
    
    private TextView mTextView;
    private ImageView jpgView;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mTextView = (TextView) this.findViewById(R.id.textview);
        
        mTextView.setText(Integer.toString(getKeypointNum()));
        
        ImageView jpgView = (ImageView)findViewById(R.id.jpgview);
        String myJpgPath = "/sdcard/consrc.jpg";
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = 2;
        Bitmap bm = BitmapFactory.decodeFile(myJpgPath, options);
        jpgView.setImageBitmap(bm);
    }
    
    public native int 	getKeypointNum();

    static {
        System.loadLibrary("HelloWorld");
    }
}